using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharpPieces.DemoApp
{

    public partial class GridViewExtenderFunctionality : Page
    {

        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            this.GridViewExtender1.Visible = this.CheckBox1.Checked;

            this.GridView1.DataSource = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures);
            this.GridView1.DataBind();
        }

        /// <summary>
        /// Handles the PageIndexChanging event of the GridView1 control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.Web.UI.WebControls.GridViewPageEventArgs"/> instance containing the event data.</param>
        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this.GridView1.PageIndex = e.NewPageIndex;

            this.GridView1.DataSource = System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures);
            this.GridView1.DataBind();
        }

    }

}
